#region Summary

// 
// Owner : JackieHan 
// 
// Solution : LearnSolution 
// 
// Project : JackieHan.NHibernate3.Test
// 
// File : TestSerializeMapping.cs
// 
// CopyRight : Copyright © 2010-2011 Skomart Corporation, All Rights Reserved 
// 
// Summary : 测试序列化Domain的Mapping配置到Xml
// 
// History : 
//			2010-09-14 13:04:22	    Create 
// 

#endregion

#region Using

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.SqlClient;
using JackieHan.NHibernate3.Domain;
using JackieHan.NHibernate3.Repository;
using NHibernate;
using NUnit.Framework;

#endregion

namespace JackieHan.NHibernate3.Test
{
    /// <summary> 
    /// 测试序列化Domain的Mapping配置到Xml
    /// </summary>
    [TestFixture]
    public class TestNHSessionFactory
    {
        [Test]
        public void TestShowXmlMapping()
        {
            NHSessionFactory.ShowXmlMapping<ManyToManyBag>();
        }

        [Test]
        public void TestGetSessionFactory()
        {
            ISessionFactory sessionFactory = NHSessionFactory.SessionFactory;
            Assert.That(1, Is.GreaterThanOrEqualTo(sessionFactory.Statistics.EntityNames.Length));
        }

        [Test]
        public void TestOpenConnection()
        {
            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["learn"].ConnectionString);
            conn.Open();
        }
    }
}